import request from '@/utils/request';

export async function adminUserlist() {
  return request('/api/admin/authority/Admlist', {
    method: 'get',
  });
}

export async function adminUserAdd(params) {
  return request('/api/admin/authority/Admin_add', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function adminUserRemove(params) {
  return request('/api/admin/authority/Admin_remove', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function adminUserDel(params) {
  return request('/api/admin/authority/Admin_del', {
    method: 'POST',
    body: {
      key: params.key,
    },
  });
}

export async function adminRolelist() {
  return request('/api/admin/authority/admin/roles', {
    method: 'get',
  });
}

export async function adminRoleadd(params) {
  return request('/api/admin/authority/roles/add', {
    method: 'POST',
    body: {
      name: params.name,
      permission: params.permission,
    },
  });
}

export async function adminRoledel(params) {
  return request('/api/admin/authority/roles/del', {
    method: 'POST',
    body: {
      id: params.key,
    },
  });
}

export async function adminRoleremove(params) {
  return request('/api/admin/authority/roles/remove', {
    method: 'POST',
    body: {
      id: params.key,
      name: params.name,
      permission: params.permission,
    },
  });
}

export async function adminPerList() {
  return request('/api/admin/authority/per/list', {
    method: 'get',
  });
}

export async function adminPerRemove(params) {
  return request('/api/admin/authority/per/remove', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function adminPerDel(params) {
  return request('/api/admin/authority/per/del', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function adminPerAdd(params) {
  return request('/api/admin/authority/per/add', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
